<template>
  <div class="el-tag" :class="'el-' + type">
    <span class="el-tag-content">
      <slot></slot>
    </span>
    <span v-if="closed" class="el-tag-close">x</span>
  </div>
</template>

<script>
export default {
  props: {
    closed: {
      type: Boolean,
      default: false,
    },
    type: {
      type: String,
    },
  },
}
</script>

<style lang="scss" scoped>
.el-tag {
  background-color: #ecf5ff;
  display: inline-block;
  height: 32px;
  padding: 0 10px;
  line-height: 30px;
  font-size: 12px;
  color: #409eff;
  border: 1px solid #d9ecff;
  border-radius: 4px;
  box-sizing: border-box;
  white-space: nowrap;
  cursor: pointer;
  &.el-danger {
    background-color: #fef0f0;
    border-color: #fde2e2;
    color: #f56c6c;
  }
  &.el-success {
    background-color: #f0f9eb;
    border-color: #e1f3d8;
    color: #67c23a;
  }
  &.el-info {
    background-color: #f4f4f5;
    border-color: #e9e9eb;
    color: #909399;
  }
  &.el-warning {
    background-color: #fdf6ec;
    border-color: #faecd8;
    color: #e6a23c;
  }
}
</style>
